<div id="modals">

    <!--modals-->
</div>
<div class="row">
    <div class="top-handle-btn">


    </div>
</div>
<div class="row">

    <form id="lite-form" action="javascript:;" method="post">
        <input type="hidden" value="" name="id"/>
        <table id="data-table" class="table table-striped table-bordered table-hover" width="100%">
            <tr>
                <th>店名</th>
                <td>
                    <!--文本框-->
                    <input type="text" class=" input-large form-control inline" name="liteName"
                           placeholder=""/>
                </td>
            </tr>
            <tr>
                <th>联系电话</th>
                <td>
                    <!--文本框-->
                    <input type="text" class=" input-large form-control inline" name="tel"
                           placeholder=""/>
                </td>
            </tr>
            <tr>
                <th>地址</th>
                <td class="pcd">
                    <select name="province" class="prov form-control input-small inline margin-bottom-10">
                    </select>
                    <select name="city" class="city form-control input-small inline margin-bottom-10"
                            style="display: none">
                    </select>
                    <select name="area" class="dist form-control input-small inline margin-bottom-10"
                            style="display: none">
                    </select>
                    <input type="text" class="form-control  input-large " placeholder="详细地址" name="address"
                           style="margin-top: 10px;width: 443px !important;"/>
                </td>
            </tr>
            <tr>
                <th>二维码</th>
                <td>
                    <div>

                    </div>
                </td>
            </tr>
            <tr>
                <th>免运费金额</th>
                <td>
                    <!--文本框-->
                    <input type="number" class=" input-medium form-control inline" min="0" max="99999.99"
                           name="freePost"
                           placeholder=""/>
                </td>
            </tr>
            <tr>
                <th>积分抵扣设置</th>
                <td>
                    <!--文本框-->
                    <input type="number" class=" input-medium form-control inline" min="0" max="1"
                           name="pointsOffsetRate"
                           placeholder=""/>
                </td>
            </tr>
            <tr>
                <th>积分获取比例</th>
                <td>
                    <!--文本框-->
                    <input type="number" class=" input-medium form-control inline" min="0" max="1" name="pointsGetRate"
                           placeholder=""/>
                </td>
            </tr>
            <tr>
                <th>积分与人民币兑换比例</th>
                <td>
                    <!--文本框-->
                    <input type="number" class=" input-medium form-control inline" min="0" max="1" name="pointsRmbRate"
                           placeholder=""/>
                </td>
            </tr>
        </table>
        <button class="btn purple right save radius6"><i class="fa fa-check"></i> 保存</button>
        <button type="button" class="btn dark  btn-outline radius6 reload"><i class="fa fa-close"></i> 重新加载</button>
    </form>
</div>

<!--table-data-loader-->
<script type="text/javascript">
    $(function () {
        loadData();
        var cityInfo = localStorage.getItem("cityInfo");
        if (cityInfo != null) {
            debugger;
            $(".pcd").citySelect({nodata: "none", required: false, url: JSON.parse(cityInfo)});
        }

        $(".save").on("click", function () {
            Shinez.put("/lite/mine", $("#lite-form").serialize(), function (ret) {
                if (ret.status == 0) {
                    Shinez.tip("success", "设置更新成功");
                } else {
                    Shinez.tip("error", ret.info);
                }
            });
        });

        $(".reload").on("click", function () {
            loadData();
        });

    })

    function loadData() {
        debugger;
        Shinez.get("/lite/mine", function (ret) {
            if (ret.status == 0) {
                var obj = ret.data.lite;
                $.each(obj, function (k, v) {
                    $("*[name=" + k + "]").val(v).change();
                })
            } else {
                Shinez.tip("error", ret.info);
            }
        })
    }

</script>